﻿using System.Threading.Tasks;
using JetBrains.Annotations;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Domain.Services;

namespace ParkManagement
{
    /// <summary>
    /// 挪车管理类
    /// </summary>
    public class MoveManager : DomainService
    {
        private IRepository<Move, int> _moveRepository;

        public MoveManager(
            IRepository<Move, int> moveRepository)
        {
            _moveRepository = moveRepository;
        }

        /// <summary>
        /// 创建
        /// </summary>
        /// <param name="plateNo"></param>
        /// <param name="photo"></param>
        /// <param name="idCard"></param>
        /// <param name="tel"></param>
        /// <param name="province"></param>
        /// <param name="city"></param>
        /// <param name="area"></param>
        /// <param name="address"></param>
        public async Task<Move> CreateAsync(
            [NotNull] string plateNo,
            [NotNull] string photo,
            [NotNull] string idCard,
            [NotNull] string tel,
            [NotNull] string province,
            [NotNull] string city,
            [NotNull] string area,
            string address)
        {
            return await _moveRepository.InsertAsync(
                new Move(
                    plateNo,
                    photo,
                    idCard,
                    tel,
                    province,
                    city,
                    area,
                    address
                )
            );
        }
    }
}